package com.hsj.stream.controller;

import com.hsj.stream.service.MsgProducer;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RestController;
import pojo.User;

/**
 * @author:Teacher黄
 * @date:Created at 2020/01/05
 */
@RestController
public class StreamController {

    @Autowired
    private MsgProducer msgProducer;


    @GetMapping("/stream/send/{name}")
    public String sendMsg(@PathVariable String name){
        User user = new User();
        user.setUserName(name);

        msgProducer.send(user);

        return "success";
    }

}
